/**
 * 所有版权归 广西梧州 陈锦韬 所有
 *
 * @Title: DoubleInnerParameter
 * @Package com.rx.core.dbase.mutil
 * @Description: 双表内联
 * @author: 陈锦韬
 * @date: 2021\7\22 0022
 * @version V1.0
 * @Copyright: 2021 陈锦韬  All rights reserved.
 */
package com.rx.core.dbase.mutil.param;

import com.rx.core.base.RxBaseData;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

/**
 * @author: Administrator
 * @Description: 双表内联
 * @date: 2021\7\22 0022
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Slf4j
public class ThreeInnerParameter extends MutilTableParameter{

    public static ThreeInnerParameter build(RxBaseData rxBaseData){
        return new ThreeInnerParameter(rxBaseData);
    }

    ThreeInnerParameter(RxBaseData rxBaseData) {
        super(rxBaseData);
    }

    public String getSql(){
        String sql = "select %s from %s inner join %s on %s inner join %s on %s where %s  " + limitSql;
        return String.format(sql, selectSql,mainTable + " main", secondTable + " secondary",onSql, threeTable + " three",threeOnSql,whereSql);
    }
}
